#ifndef _VGA_H
#define _VGA_H

#include <cnix/tty.h>

#define VGA_NUM	2
#define VBUFFERSIZE	256

#define VID_MEM		0xb8000
#define VID_SIZE	0x4000

#define lines		25
#define cols		80

#define ESC_ARGV_NUM	4

struct console_struct{
	struct tty_struct * c_tty;
	int c_currow, c_curcol;
	int c_start, c_end, c_org, c_curpos;
	int c_escape;
	int c_esc_argv[ESC_ARGV_NUM];
	unsigned short c_attr;
	int c_idx;
	int c_history_pos;
	unsigned short c_data[VBUFFERSIZE];
	unsigned short c_vidmem[VID_SIZE >> 1];
	unsigned long c_realvidmem;
	int c_bak_currow, c_bak_curcol, c_bak_curpos;
	unsigned short c_bak_attr;
	int c_scroll_start, c_scroll_end;
	unsigned char c_leds;
	char c_color_reverse;
};

extern int console_write(struct tty_struct *);
extern void select_console_init(int);
extern void select_console(int);
extern void kputs(const char *);
extern void console_begin_page_up(void);
extern void console_end_page_up(void);
extern void console_begin_page_down(void);

#endif
